using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;

namespace Jbe.TestSuite.TestDevices.Interface
{
    /// <summary>
    /// Describes a test device manager.
    /// </summary>
    public interface ITestDeviceManager
    {
        /// <summary>
        /// List of all available control views.
        /// </summary>
        ReadOnlyObservableCollection<IControlView> ControlViews { get; }

        /// <summary>
        /// Register a control view factory. An instance of the device controller is created
        /// if a <see cref="IDevice"/> is registered.
        /// </summary>
        void Register(IControlViewFactory factory);
        
        /// <summary>
        /// Register a connected test device.
        /// </summary>
        void Register(IDevice device);
        
        /// <summary>
        /// Deregister a test device if it is not anymore available.
        /// </summary>
        /// <returns>True if the device was successfully deregistered; otherwise false.</returns>
        bool Deregister(IDevice device);

        void OpenDevice(IEnumerable<IControlView> controlViews);

        void RemoveDevice(IEnumerable<IControlView> controlViews);
    }
}
